package com.tj.jinzao.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.tj.jinzao.R;
import com.tj.jinzao.base.BaseListAdapter;
import com.tj.jinzao.model.ExchangeRecord;

import java.util.concurrent.CopyOnWriteArrayList;


/**
 * 家庭成员 Adapter
 * Created by wjy on 2019/1/10.
 */
public class ExchangeRecordListItemAdapter extends BaseListAdapter<ExchangeRecord, ExchangeRecordListItemAdapter.ViewHolder> {

    public ExchangeRecordListItemAdapter(Context context, CopyOnWriteArrayList data) {
        super(context, data);
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.item_exchange_record_list, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        ExchangeRecord record = mData.get(position);
        holder.name.setText(record.getName());
//        Glide.with(mContext).load(record.get).placeholder(familyMember.getGender() == 1
//                ? R.mipmap.default_head_women : R.mipmap.default_head_man).into(holder.head);
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        TextView name,score,time;
        ImageView head;

        public ViewHolder(View itemView) {
            super(itemView);
            name = itemView.findViewById(R.id.tv_name);
            score = itemView.findViewById(R.id.tv_score);
            time = itemView.findViewById(R.id.tv_time);
            head = itemView.findViewById(R.id.iv_head);
        }
    }


}
